home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3c / resolver.z / resolver
Encoding:
Text File  |  1998-10-20  |  11.8 KB  |  199 lines

  1.  
  2.  
  3.  
  4. rrrreeeessss____qqqquuuueeeerrrryyyy((((3333NNNN))))                                                    rrrreeeessss____qqqquuuueeeerrrryyyy((((3333NNNN))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      res_query, res_search, res_mkquery, res_send, res_init, dn_comp,
  10.      dn_expand - resolver routines
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeettttiiiinnnneeeetttt////iiiinnnn....hhhh>>>>
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<aaaarrrrppppaaaa////nnnnaaaammmmeeeesssseeeerrrr....hhhh>>>>
  16.      ####iiiinnnncccclllluuuuddddeeee <<<<rrrreeeessssoooollllvvvv....hhhh>>>>
  17.  
  18.      iiiinnnntttt rrrreeeessss____qqqquuuueeeerrrryyyy ((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ddddnnnnaaaammmmeeee,,,, iiiinnnntttt ccccllllaaaassssssss,,,, iiiinnnntttt ttttyyyyppppeeee,,,,
  19.                      uuuu____cccchhhhaaaarrrr ****aaaannnnsssswwwweeeerrrr,,,, iiiinnnntttt aaaannnnsssslllleeeennnn))));;;;
  20.  
  21.      iiiinnnntttt rrrreeeessss____sssseeeeaaaarrrrcccchhhh ((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ddddnnnnaaaammmmeeee,,,, iiiinnnntttt ccccllllaaaassssssss,,,, iiiinnnntttt ttttyyyyppppeeee,,,,
  22.                      uuuu____cccchhhhaaaarrrr ****aaaannnnsssswwwweeeerrrr,,,, iiiinnnntttt aaaannnnsssslllleeeennnn))));;;;
  23.  
  24.      iiiinnnntttt rrrreeeessss____mmmmkkkkqqqquuuueeeerrrryyyy ((((iiiinnnntttt oooopppp,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ddddnnnnaaaammmmeeee,,,, iiiinnnntttt ccccllllaaaassssssss,,,, iiiinnnntttt ttttyyyyppppeeee,,,,
  25.                       ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ddddaaaattttaaaa,,,, iiiinnnntttt ddddaaaattttaaaalllleeeennnn,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnneeeewwwwrrrrrrrr,,,,
  26.                       cccchhhhaaaarrrr ****bbbbuuuuffff,,,, iiiinnnntttt bbbbuuuufffflllleeeennnn))));;;;
  27.  
  28.      iiiinnnntttt rrrreeeessss____sssseeeennnndddd ((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****mmmmssssgggg,,,, iiiinnnntttt mmmmssssgggglllleeeennnn,,,, cccchhhhaaaarrrr ****aaaannnnsssswwwweeeerrrr,,,, iiiinnnntttt aaaannnnsssslllleeeennnn))));;;;
  29.  
  30.      iiiinnnntttt rrrreeeessss____iiiinnnniiiitttt ((((vvvvooooiiiidddd))));;;;
  31.  
  32.      iiiinnnntttt ddddnnnn____ccccoooommmmpppp ((((ccccoooonnnnsssstttt uuuu____cccchhhhaaaarrrr ****eeeexxxxpppp____ddddnnnn,,,, uuuu____cccchhhhaaaarrrr ****ccccoooommmmpppp____ddddnnnn,,,, iiiinnnntttt lllleeeennnnggggtttthhhh,,,,
  33.                   uuuu____cccchhhhaaaarrrr ********ddddnnnnppppttttrrrrssss,,,, uuuu____cccchhhhaaaarrrr ********llllaaaassssttttddddnnnnppppttttrrrr))));;;;
  34.  
  35.      iiiinnnntttt ddddnnnn____eeeexxxxppppaaaannnndddd ((((ccccoooonnnnsssstttt uuuu____cccchhhhaaaarrrr ****mmmmssssgggg,,,, ccccoooonnnnsssstttt uuuu____cccchhhhaaaarrrr ****eeeeoooommmmoooorrrriiiigggg,,,,
  36.                     ccccoooonnnnsssstttt uuuu____cccchhhhaaaarrrr ****ccccoooommmmpppp____ddddnnnn,,,, cccchhhhaaaarrrr ****eeeexxxxpppp____ddddnnnn,,,, iiiinnnntttt lllleeeennnnggggtttthhhh))));;;;
  37.  
  38. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  39.      These routines are used for making, sending, and interpreting query and
  40.      reply messages with Internet domain name servers.
  41.  
  42.      Global configuration and state information that is used by the resolver
  43.      routines is kept in the structure __r_e_s.  Most of the values have
  44.      reasonable defaults and can be ignored.  Options stored in __r_e_s._o_p_t_i_o_n_s
  45.      are defined in _r_e_s_o_l_v._h and are as follows.  Options are stored as a
  46.      simple bit mask containing the bitwise ``or'' of the options enabled.
  47.  
  48.      RES_INIT       True if the initial name server address and default domain
  49.                     name are initialized (_r_e_s__i_n_i_t has been called).
  50.  
  51.      RES_DEBUG      Print debugging messages.
  52.  
  53.      RES_AAONLY     Accept authoritative answers only.  With this option,
  54.                     _r_e_s__s_e_n_d should continue until it finds an authoritative
  55.                     answer or finds an error.  Currently this is not
  56.                     implemented.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. rrrreeeessss____qqqquuuueeeerrrryyyy((((3333NNNN))))                                                    rrrreeeessss____qqqquuuueeeerrrryyyy((((3333NNNN))))
  71.  
  72.  
  73.  
  74.      RES_USEVC      Use TCP connections for queries instead of UDP datagrams.
  75.  
  76.      RES_STAYOPEN   Used with RES_USEVC to keep the TCP connection open
  77.                     between queries.  This is useful only in programs that
  78.                     regularly do many queries.  UDP should be the normal mode
  79.                     used.
  80.  
  81.      RES_IGNTC      Unused currently (ignore truncation errors; don't retry
  82.                     with TCP).
  83.  
  84.      RES_RECURSE    Set the recursion-desired bit in queries.  This is the
  85.                     default.  (_r_e_s__s_e_n_d does not do iterative queries and
  86.                     expects the name server to handle recursion.)
  87.  
  88.      RES_DEFNAMES   If set, _r_e_s__s_e_a_r_c_h appends the default domain name to
  89.                     single-component names (those that do not contain a dot).
  90.                     This option is enabled by default.
  91.  
  92.      RES_DNSRCH     If this option is set, _r_e_s__s_e_a_r_c_h searches for hostnames
  93.                     in the current domain and in parent domains; see
  94.                     _h_o_s_t_n_a_m_e(5).  This is used by the standard host lookup
  95.                     routine _g_e_t_h_o_s_t_b_y_n_a_m_e(3N).  This option is enabled by
  96.                     default.
  97.  
  98.      The _r_e_s__i_n_i_t routine reads the configuration file (if any; see
  99.      _r_e_s_o_l_v_e_r(4)) to get the default domain name, search list and the Internet
  100.      address of the local name server(s).  If no server is configured, the
  101.      host running the resolver is tried.  The current domain name is defined
  102.      by the hostname if not specified in the configuration file; it can be
  103.      overridden by the environment variable LOCALDOMAIN.  Initialization
  104.      normally occurs on the first call to one of the following routines.
  105.  
  106.      The _r_e_s__q_u_e_r_y function provides an interface to the server query
  107.      mechanism.  It constructs a query, sends it to the local server, awaits a
  108.      response, and makes preliminary checks on the reply.  The query requests
  109.      information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully-
  110.      qualified domain name _d_n_a_m_e.  The reply message is left in the _a_n_s_w_e_r
  111.      buffer with length _a_n_s_l_e_n supplied by the caller.
  112.  
  113.      The _r_e_s__s_e_a_r_c_h routine makes a query and awaits a response like
  114.      _r_e_s__q_u_e_r_y, but in addition, it implements the default and search rules
  115.      controlled by the RES_DEFNAMES and RES_DNSRCH options.  It returns the
  116.      first successful reply.
  117.  
  118.      The remaining routines are lower-level routines used by _r_e_s__q_u_e_r_y.  The
  119.      _r_e_s__m_k_q_u_e_r_y function constructs a standard query message and places it in
  120.      _b_u_f.  It returns the size of the query, or -1 if the query is larger than
  121.      _b_u_f_l_e_n.  The query type _o_p is usually QUERY, but can be any of the query
  122.      types defined in <_a_r_p_a/_n_a_m_e_s_e_r._h>.  The domain name for the query is
  123.      given by _d_n_a_m_e.  _n_e_w_r_r is currently unused but is intended for making
  124.      update messages.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. rrrreeeessss____qqqquuuueeeerrrryyyy((((3333NNNN))))                                                    rrrreeeessss____qqqquuuueeeerrrryyyy((((3333NNNN))))
  137.  
  138.  
  139.  
  140.      The _r_e_s__s_e_n_d routine sends a preformatted query and returns an answer.
  141.      It calls _r_e_s__i_n_i_t if RES_INIT is not set, sends the query to the local
  142.      name server, and handles timeouts and retries.  The length of the reply
  143.      message is returned, or -1 if there were errors.
  144.  
  145.      The _d_n__c_o_m_p function compresses the domain name _e_x_p__d_n and stores it in
  146.      _c_o_m_p__d_n.  The size of the compressed name is returned or -1 if there were
  147.      errors.  The size of the array pointed to by _c_o_m_p__d_n is given by _l_e_n_g_t_h.
  148.      The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed
  149.      names in the current message.  The first pointer points to the beginning
  150.      of the message and the list ends with NULL.  The limit to the array is
  151.      specified by _l_a_s_t_d_n_p_t_r.  A side effect of _d_n__c_o_m_p is to update the list
  152.      of pointers for labels inserted into the message as the name is
  153.      compressed.  If _d_n_p_t_r is NULL, names are not compressed.  If _l_a_s_t_d_n_p_t_r is
  154.      NULL, the list of labels is not updated.
  155.  
  156.      The _d_n__e_x_p_a_n_d entry expands the compressed domain name _c_o_m_p__d_n to a full
  157.      domain name The compressed name is contained in a query or reply message;
  158.      _m_s_g is a pointer to the beginning of the message.  The uncompressed name
  159.      is placed in the buffer indicated by _e_x_p__d_n, which is of size _l_e_n_g_t_h.
  160.      The size of compressed name is returned or -1 if there was an error.
  161.  
  162. FFFFIIIILLLLEEEESSSS
  163.      /etc/resolv.conf    see resolver(4)
  164.  
  165. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  166.      named(1M), gethostbyname(3N), resolver(4), hostname(5).
  167.  
  168.      RFC1032, RFC1033, RFC1034, RFC1035, RFC974
  169.  
  170.      _I_R_I_X _A_d_m_i_n: _N_e_t_w_o_r_k_i_n_g _a_n_d _M_a_i_l
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.